﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PMisuseAn.behaviour.adaptation
{
    public class AdaptationDescriptorBinding
    {
        string seqTimeline_;
        //string threatMessageTransition_;
        //string violatingPolicyStatement_;
        //string violatingContext_;
        //string rationale_;
        string attSensLevel_;
         string sensitivityLevelConstant_;
         string sensitivityLevelUtilitys_;
         string attObfsLevel_;
         string obfuscationLevelConstant_;
         string obfuscationLevelUtilitys_;
         string individualAdaptationAction_;
         string individualExpectedUtility_;
         string aggregateAdaptationAction_;
         string adaptationRule_;
         string metaAdaptationRule_;
         string threatFrequencies_;
         string h_adaptationActions_;

         public string seqTimeline
         {
             get
             {
                 return seqTimeline_;
             }
             set
             {
                 seqTimeline_ = value;
             }
         }
         
         //public string threatMessageTransition
         //{
         //    get
         //    {
         //        return threatMessageTransition_;
         //    }
         //    set
         //    {
         //        threatMessageTransition_ = value;
         //    }
         //}
         //public string violatingPolicyStatement
         //{
         //    get
         //    {
         //        return violatingPolicyStatement_;
         //    }
         //    set
         //    {
         //        violatingPolicyStatement_ = value;
         //    }
         //}
         //public string violatingContext
         //{
         //    get
         //    {
         //        return violatingContext_;
         //    }
         //    set
         //    {
         //        violatingContext_ = value;
         //    }
         //}
         //public string rationale
         //{
         //    get
         //    {
         //        return rationale_;
         //    }
         //    set
         //    {
         //        rationale_ = value;
         //    }
         //}
         public string attObfsLevel
         {
             get
             {
                 return attObfsLevel_;
             }
             set
             {
                 attObfsLevel_ = value;
             }
         }
         public string attSensLevel
         {
             get
             {
                 return attSensLevel_;
             }
             set
             {
                 attSensLevel_ = value;
             }
         }
         public string attAdaptationAction
         {
             get
             {
                 return individualAdaptationAction_;
             }
             set
             {
                 individualAdaptationAction_ = value;
             }
         }
         public string attExpectedUtility
         {
             get
             {
                 return individualExpectedUtility_;
             }
             set
             {
                 individualExpectedUtility_ = value;
             }
         }
         public string aggregateAdaptationAction
         {
             get
             {
                 return aggregateAdaptationAction_;
             }
             set
             {
                 aggregateAdaptationAction_ = value;
             }
         }
         public string adaptationRule
         {
             get
             {
                 return adaptationRule_;
             }
             set
             {
                 adaptationRule_ = value;
             }
         }
         public string metaAdaptationRule
         {
             get
             {
                 return metaAdaptationRule_;
             }
             set
             {
                 metaAdaptationRule_ = value;
             }
         }
         public string threatFrequencies
         {
             get
             {
                 return threatFrequencies_;
             }
             set
             {
                 threatFrequencies_ = value;
             }
         }
         public string historyAdaptationActions
         {
             get
             {
                 return h_adaptationActions_;
             }
             set
             {
                 h_adaptationActions_ = value;
             }
         }

         public string SLConstant
         {
             get
             {
                 return sensitivityLevelConstant_;
             }
             set
             {
                 sensitivityLevelConstant_ = value;
             }
         }
         public string SLUtilities
         {
             get
             {
                 return sensitivityLevelUtilitys_;
             }
             set
             {
                 sensitivityLevelUtilitys_ = value;
             }
         }
         
         public string OLConstant
         {
             get
             {
                 return obfuscationLevelConstant_;
             }
             set
             {
                 obfuscationLevelConstant_ = value;
             }
         }
         public string OLUtilities
         {
             get
             {
                 return obfuscationLevelUtilitys_;
             }
             set
             {
                 obfuscationLevelUtilitys_ = value;
             }
         }
         


        public List<AdaptationBindingInverse> getPropertyValues()
        {
            List<AdaptationBindingInverse> ppties = new List<AdaptationBindingInverse>();
            
            AdaptationBindingInverse ai1 = new AdaptationBindingInverse();
            ai1.Property = "Timeline";
            ai1.Value = seqTimeline;
            ppties.Add(ai1);

            AdaptationBindingInverse ai9 = new AdaptationBindingInverse();
            ai9.Property = "Attribute"+"\r\n"+"Obfuscation"+"\r\n"+"Level";
            ai9.Value = attObfsLevel + "\n";
            ppties.Add(ai9);

            AdaptationBindingInverse ai6 = new AdaptationBindingInverse();
            ai6.Property = "Attribute"+"\r\n"+"Sensitivity"+"\r\n"+"Level";
            ai6.Value = attSensLevel + "\n";
            ppties.Add(ai6);

            AdaptationBindingInverse ai12 = new AdaptationBindingInverse();
            ai12.Property = "Attribute"+"\r\n"+"Adaptation"+"\r\n"+"Action";
            ai12.Value = attAdaptationAction + "\n";
            ppties.Add(ai12);                      

            AdaptationBindingInverse ai14 = new AdaptationBindingInverse();
            ai14.Property = "Aggregate"+"\r\n"+"Adaptation"+"\r\n"+"Action";
            ai14.Value = aggregateAdaptationAction + "\n";
            ppties.Add(ai14);

            AdaptationBindingInverse ai17 = new AdaptationBindingInverse();
            ai17.Property = "Threat"+"\r\n"+"Frequency";
            ai17.Value = threatFrequencies + "\n";
            ppties.Add(ai17);

            AdaptationBindingInverse ai15 = new AdaptationBindingInverse();
            ai15.Property = "Adaptation"+"\r\n"+"Rule";
            ai15.Value = adaptationRule + "\n";
            ppties.Add(ai15);

            AdaptationBindingInverse ai16 = new AdaptationBindingInverse();
            ai16.Property = "Meta-"+"\r\n"+"Adaptation"+"\r\n"+"Rule";
            ai16.Value = metaAdaptationRule + "\n";
            ppties.Add(ai16);

            AdaptationBindingInverse ai18 = new AdaptationBindingInverse();
            ai18.Property = "History"+"\r\n"+"Actions";
            ai18.Value = historyAdaptationActions + "\n";
            ppties.Add(ai18);

            //AdaptationBindingInverse ai2 = new AdaptationBindingInverse();
            //ai2.Property = "Threat"+"\r\n"+"Message"+"\r\n"+"Trans";
            //ai2.Value = threatMessageTransition + "\r\n";
            //ppties.Add(ai2);

            //AdaptationBindingInverse ai3 = new AdaptationBindingInverse();
            //ai3.Property = "Violated"+"\r\n"+"Policy";
            //ai3.Value = violatingPolicyStatement + "\n";
            //ppties.Add(ai3);

            //AdaptationBindingInverse ai4 = new AdaptationBindingInverse();
            //ai4.Property = "Violating"+"\r\n"+"Context";
            //ai4.Value = violatingContext + "\n";
            //ppties.Add(ai4);

            //AdaptationBindingInverse ai5 = new AdaptationBindingInverse();
            //ai5.Property = "rationale";
            //ai5.Value = rationale + "\n";
            //ppties.Add(ai5);

            AdaptationBindingInverse ai7 = new AdaptationBindingInverse();
            ai7.Property = "SLConstant";
            ai7.Value = SLConstant + "\n";
            ppties.Add(ai7);

            AdaptationBindingInverse ai8 = new AdaptationBindingInverse();
            ai8.Property = "SLUtilities";
            ai8.Value = SLUtilities + "\n";
            ppties.Add(ai8);            

            AdaptationBindingInverse ai10 = new AdaptationBindingInverse();
            ai10.Property = "OLConstant";
            ai10.Value = OLConstant + "\n";
            ppties.Add(ai10);

            AdaptationBindingInverse ai11 = new AdaptationBindingInverse();
            ai11.Property = "OLUtilities";
            ai11.Value = OLUtilities + "\n";
            ppties.Add(ai11);

            AdaptationBindingInverse ai13 = new AdaptationBindingInverse();
            ai13.Property = "Attribute"+"\r\n"+"Expected"+"\r\n"+"Utility";
            ai13.Value = attExpectedUtility + "\n";
            ppties.Add(ai13);
            
            return ppties;
        }
    }
}
